qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
6,073,935
I have installed the Java 3D API on PC via the exe installer, which simply created a new directory with `j3dcore.jar`, `vecmath.jar`, `j3dutils.jar` in a lib sub-directory and `j3dcore-ogl.dll` in a bin sub-directory. Netbeans had no issues and my code compiled and executed smoothly, however once I built my project an...
2011/05/20
[ "https://Stackoverflow.com/questions/6073935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639422/" ]
> > Making my Java program easily distributable > > > If you mean 'easy for the end user' look to [Java Web Start](https://stackoverflow.com/tags/java-web-start/info). --- A passer-by asks: > > Can you package the dll dependencies with Web Start? > > > Yes, but much, much better. You can package the nativ...
If you put the dlls in the same directory than you Jar, does it work? If yes, you could consider distributing it like this.
6,073,935
I have installed the Java 3D API on PC via the exe installer, which simply created a new directory with `j3dcore.jar`, `vecmath.jar`, `j3dutils.jar` in a lib sub-directory and `j3dcore-ogl.dll` in a bin sub-directory. Netbeans had no issues and my code compiled and executed smoothly, however once I built my project an...
2011/05/20
[ "https://Stackoverflow.com/questions/6073935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639422/" ]
*Edit - After re-reading your question, your issue sounds different. However I'm able to get my running like so, by just dropping all dll files in the same directory as the .bat file starting the java process:* *java -classpath ./YourJar.jar;./lib/j3dcore.jar;./lib/vecmath.jar;./lib/j3dutils.jar package.MainClass* *A...
If you put the dlls in the same directory than you Jar, does it work? If yes, you could consider distributing it like this.
6,073,935
I have installed the Java 3D API on PC via the exe installer, which simply created a new directory with `j3dcore.jar`, `vecmath.jar`, `j3dutils.jar` in a lib sub-directory and `j3dcore-ogl.dll` in a bin sub-directory. Netbeans had no issues and my code compiled and executed smoothly, however once I built my project an...
2011/05/20
[ "https://Stackoverflow.com/questions/6073935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639422/" ]
> > Making my Java program easily distributable > > > If you mean 'easy for the end user' look to [Java Web Start](https://stackoverflow.com/tags/java-web-start/info). --- A passer-by asks: > > Can you package the dll dependencies with Web Start? > > > Yes, but much, much better. You can package the nativ...
I guess DLL are searched in all folders in %PATH% on windows. (LD\_LIBRARY\_PATH for UNIX flavors) Could you try by adding the path to dll to %path% variable? It appears that you are trying package a product with many jars as dependencies. You may benefit from [One-Jar](http://one-jar.sourceforge.net/index.php?page=d...
6,073,935
I have installed the Java 3D API on PC via the exe installer, which simply created a new directory with `j3dcore.jar`, `vecmath.jar`, `j3dutils.jar` in a lib sub-directory and `j3dcore-ogl.dll` in a bin sub-directory. Netbeans had no issues and my code compiled and executed smoothly, however once I built my project an...
2011/05/20
[ "https://Stackoverflow.com/questions/6073935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639422/" ]
*Edit - After re-reading your question, your issue sounds different. However I'm able to get my running like so, by just dropping all dll files in the same directory as the .bat file starting the java process:* *java -classpath ./YourJar.jar;./lib/j3dcore.jar;./lib/vecmath.jar;./lib/j3dutils.jar package.MainClass* *A...
I guess DLL are searched in all folders in %PATH% on windows. (LD\_LIBRARY\_PATH for UNIX flavors) Could you try by adding the path to dll to %path% variable? It appears that you are trying package a product with many jars as dependencies. You may benefit from [One-Jar](http://one-jar.sourceforge.net/index.php?page=d...
44,608,964
``` pt=new Date(2019,11,12,8,2,3) console.log(pt.getFullYear()," ",pt.getMonth()); ``` gives result `2019 " " 11` ``` console.log(pt.getFullYear()+" "+pt.getMonth()); ``` gives the result as `2019 11` What is the difference between using, and + in this example?
2017/06/17
[ "https://Stackoverflow.com/questions/44608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3967709/" ]
The first of these gives three separate arguments to console.log, while the second appends the three together, then passes that as a single argument to console.log.
With the (,) you're with the console.log you're requesting to show a separate group of items as string, making a kind of array. When you put the (+) symbol you are adding the strings, and in this case the " " is just adding a space between the first and the second string. It is called concatenation.
44,608,964
``` pt=new Date(2019,11,12,8,2,3) console.log(pt.getFullYear()," ",pt.getMonth()); ``` gives result `2019 " " 11` ``` console.log(pt.getFullYear()+" "+pt.getMonth()); ``` gives the result as `2019 11` What is the difference between using, and + in this example?
2017/06/17
[ "https://Stackoverflow.com/questions/44608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3967709/" ]
The first of these gives three separate arguments to console.log, while the second appends the three together, then passes that as a single argument to console.log.
console.log is part of the Console API and is accesible in various browsers. You can find its full documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Console/log). It states that console log has the following parameters: ``` obj1 ... objN ``` > > A list of JavaScript objects to output. The str...
44,608,964
``` pt=new Date(2019,11,12,8,2,3) console.log(pt.getFullYear()," ",pt.getMonth()); ``` gives result `2019 " " 11` ``` console.log(pt.getFullYear()+" "+pt.getMonth()); ``` gives the result as `2019 11` What is the difference between using, and + in this example?
2017/06/17
[ "https://Stackoverflow.com/questions/44608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3967709/" ]
``` console.log(pt.getFullYear()," ",pt.getMonth()); ``` The above example passes three separate arguments to console.log. What it outputs depends on how `console.log` is implemented. It has changed over time and is little bit different between browsers. When invoked with arguments like in the example, it has access ...
With the (,) you're with the console.log you're requesting to show a separate group of items as string, making a kind of array. When you put the (+) symbol you are adding the strings, and in this case the " " is just adding a space between the first and the second string. It is called concatenation.
44,608,964
``` pt=new Date(2019,11,12,8,2,3) console.log(pt.getFullYear()," ",pt.getMonth()); ``` gives result `2019 " " 11` ``` console.log(pt.getFullYear()+" "+pt.getMonth()); ``` gives the result as `2019 11` What is the difference between using, and + in this example?
2017/06/17
[ "https://Stackoverflow.com/questions/44608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3967709/" ]
``` console.log(pt.getFullYear()," ",pt.getMonth()); ``` The above example passes three separate arguments to console.log. What it outputs depends on how `console.log` is implemented. It has changed over time and is little bit different between browsers. When invoked with arguments like in the example, it has access ...
console.log is part of the Console API and is accesible in various browsers. You can find its full documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Console/log). It states that console log has the following parameters: ``` obj1 ... objN ``` > > A list of JavaScript objects to output. The str...
343,937
I need to take some online tests for school. This website tells me I need Flash Player 11.3.0 or higher. As far as I can see that is not yet avaible for Linux. I use Ubuntu 12.04 LTS and Chromium. Is there a way I can work around it? Greetz. Rob.
2013/09/10
[ "https://askubuntu.com/questions/343937", "https://askubuntu.com", "https://askubuntu.com/users/191781/" ]
The best way to get Flash Player 11.2+ is to use Google Chrome in Ubuntu. There is no other way to get it, because a higher version has not been released for Ubuntu. [Download Google Chrome From Here](https://www.google.com/intl/en/chrome/browser/) Select your OS version x86 or x64 and download it to any path. Then ...
sudo apt-get install wine Download Firefox for Windows Visit Youtube and install the addon that pops up. You now have the latest version of Flash!
40,155,466
we got homework to make convertor of weights where the fields are updated while typing the number (no need to click "calculate" or anything). one of the students offered the code below. the code works: when putting a number in field 1, field 2 changes while typing. what i dont understand is how does that work? in the ...
2016/10/20
[ "https://Stackoverflow.com/questions/40155466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6932394/" ]
I'm going to focus on just 1 of the text fields to answer this. Look at this first line: `kgEdit = (EditText) findViewById(R.id.kgEdit);` All this does is get a reference to the `EditText` for entering kg. Now that there is a reference, we can call methods on that object. Next, we have this: ``` kgEdit.setOnKeyList...
You have to use addTextChangedListener like this- ``` EditText editText = (EditText) findViewById(R.id.editText1); editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override pu...
19,074,447
I have to go into a table to retrieve a parameter, then go back into the same table to retrieve data based on the parameter. ``` <cfquery name = "selnm" datasource = "Moxart"> select SelName from AuxXref where Fieldname = <cfqueryparam value = "#orig#"> </cfquery> <cfset selname = selnm.SelName> <cfquery name = "...
2013/09/29
[ "https://Stackoverflow.com/questions/19074447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497281/" ]
You can do this in one query like so: ``` <cfquery name = "fld" datasource = "Moxart"> select Fieldname, DBname, SelName from AuxXref where SelName = <cfqueryparam value = "#orig#"> AND FieldName = <cfqueryparam value = "#orig#"> </cfquery> ```
Something like this might satisfy your requirements. ``` select fieldname, DBname from AuxXref where selname in (select distinct selname from auxXref where fieldname = <cfqueryparam value = "#orig#"> ) and fieldname <> <cfqueryparam value = "#orig#"> ``` If the subquery returns more than one row, and you only wan...
115,794
**Rules** 1. Place some pentominoes into an 8 x 8 grid. They do not touch each other. They can touch only diagonally (with corner). 2. Pentominoes cannot repeat in the grid. Rotations and reflections of a pentomino are considered the same shape. 3. Grid is 8 x 8.
2022/04/17
[ "https://puzzling.stackexchange.com/questions/115794", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/79520/" ]
With integer programming, I managed to place > > 8 pieces, proved to be optimal > > > like this. > > $$\begin{array}{cccccccc} 3&3&3&3& &5&5&5\\ 3& & & & &5& &5\\ &4&4&4&4& &A&\\ 6& & &4& &A&A&A\\ 6&6&6& &8& &A&\\ & &6& &8&8& &B\\ 2&2& &8&8& &B&B\\2&2&2& & &B&B&\\ \end{array}$$ > > > Here is my formulation...
I can manage > > seven pentominoes, in a few different ways: > > > > [![seven pentominoes](https://i.stack.imgur.com/FPIEH.png)](https://i.stack.imgur.com/FPIEH.png) [![seven again](https://i.stack.imgur.com/rVcqQ.png)](https://i.stack.imgur.com/rVcqQ.png) > > > There is an obvious upper bound of > > t...
115,794
**Rules** 1. Place some pentominoes into an 8 x 8 grid. They do not touch each other. They can touch only diagonally (with corner). 2. Pentominoes cannot repeat in the grid. Rotations and reflections of a pentomino are considered the same shape. 3. Grid is 8 x 8.
2022/04/17
[ "https://puzzling.stackexchange.com/questions/115794", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/79520/" ]
I solved this completely by hand. > > ![solution with 8 pentominos](https://i.stack.imgur.com/0ksZz.png) > > > Here is a clean proof of its optimality. No computer is needed. Mere pencil and paper suffice. Expand each pentomino by adding little right-angled isosceles triangles with area 1/4 as follows: 1. For ...
I can manage > > seven pentominoes, in a few different ways: > > > > [![seven pentominoes](https://i.stack.imgur.com/FPIEH.png)](https://i.stack.imgur.com/FPIEH.png) [![seven again](https://i.stack.imgur.com/rVcqQ.png)](https://i.stack.imgur.com/rVcqQ.png) > > > There is an obvious upper bound of > > t...
44,410,809
I'm looking for changing the **TextView** Sizes automatically. And I found the solution as well. Here is the official [Doc](https://developer.android.com/preview/features/autosizing-textview.html) for Auto sizing textviews. But Still I'm not able to resolve it. When i paste autoSizeTextType its showing error in xml fil...
2017/06/07
[ "https://Stackoverflow.com/questions/44410809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3824298/" ]
As stated in the [docs](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview.html#setting-textview-autosize): > > The Support Library 26.0 provides full support to the autosizing TextView feature on devices running Android versions prior to Android 8.0 (API level 26). The library provides ...
This API is available only from API level 26.
44,410,809
I'm looking for changing the **TextView** Sizes automatically. And I found the solution as well. Here is the official [Doc](https://developer.android.com/preview/features/autosizing-textview.html) for Auto sizing textviews. But Still I'm not able to resolve it. When i paste autoSizeTextType its showing error in xml fil...
2017/06/07
[ "https://Stackoverflow.com/questions/44410809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3824298/" ]
Use AppCompatTextView and supportLibrary 26.0.1 ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android...
This API is available only from API level 26.
44,410,809
I'm looking for changing the **TextView** Sizes automatically. And I found the solution as well. Here is the official [Doc](https://developer.android.com/preview/features/autosizing-textview.html) for Auto sizing textviews. But Still I'm not able to resolve it. When i paste autoSizeTextType its showing error in xml fil...
2017/06/07
[ "https://Stackoverflow.com/questions/44410809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3824298/" ]
As stated in the [docs](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview.html#setting-textview-autosize): > > The Support Library 26.0 provides full support to the autosizing TextView feature on devices running Android versions prior to Android 8.0 (API level 26). The library provides ...
Use AppCompatTextView and supportLibrary 26.0.1 ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android...
2,829,287
For example, User adds this "iamsmelly.com". And if I add an href to this, the link would be www.mywebsite.com/iamsmelly.com Is there a way to make it absolute if its not prepended by an http:// ? Or should I revert to jQuery for this?
2010/05/13
[ "https://Stackoverflow.com/questions/2829287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93311/" ]
Probably a good place to handle this is in a `before_save` on your model. I'm not aware of a predefined helper (though `auto_link` comes somewhat close) but a relatively simple regexp should do the job: ``` class User < ActiveRecord::Base before_save :check_links def check_links self.link = "http://" + self...
I've looked for something similar before with no luck. I made a helper method like so: ``` def ensure_absolute(str_link) (str_link.include?("http://") || str_link.include?("https://")) ? str_link : ("http://"+str_link) end ```
16,114,993
I have a `<div id="content">`. I want to load the content from <http://vietduc24h.com> into my `div`: ``` <html> <head> <script type="text/javascript"> $(document).ready(function() { $("#content").attr("src","http://vietduc24h.com"); }) </script> </head> <body> <div id="content"></div> </body>...
2013/04/19
[ "https://Stackoverflow.com/questions/16114993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300976/" ]
You need to think about CORS in this aspect. The code you need to have is: ``` <script type="text/javascript"> $(document).ready(function() { $("#content").load("http://vietduc24h.com"); }) </script> ``` When your domain is not inside `vietduc24h.com`, you might get some security exception. In or...
Try this code with the jQuery `Load` function: ``` $('#content').load('http://vietduc24h.com', function() { alert('Load was performed.'); }); ``` If you encounter in security issues because of the Cross-Origin-Resource-Sharing policy than you have to use a proxy in your server code.
16,114,993
I have a `<div id="content">`. I want to load the content from <http://vietduc24h.com> into my `div`: ``` <html> <head> <script type="text/javascript"> $(document).ready(function() { $("#content").attr("src","http://vietduc24h.com"); }) </script> </head> <body> <div id="content"></div> </body>...
2013/04/19
[ "https://Stackoverflow.com/questions/16114993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300976/" ]
Try this code with the jQuery `Load` function: ``` $('#content').load('http://vietduc24h.com', function() { alert('Load was performed.'); }); ``` If you encounter in security issues because of the Cross-Origin-Resource-Sharing policy than you have to use a proxy in your server code.
Try this: ``` $("#content").html('<object data="http://vietduc24h.com">'); ``` Taken from [this answer](https://stackoverflow.com/a/9964050/646668).
16,114,993
I have a `<div id="content">`. I want to load the content from <http://vietduc24h.com> into my `div`: ``` <html> <head> <script type="text/javascript"> $(document).ready(function() { $("#content").attr("src","http://vietduc24h.com"); }) </script> </head> <body> <div id="content"></div> </body>...
2013/04/19
[ "https://Stackoverflow.com/questions/16114993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300976/" ]
You need to think about CORS in this aspect. The code you need to have is: ``` <script type="text/javascript"> $(document).ready(function() { $("#content").load("http://vietduc24h.com"); }) </script> ``` When your domain is not inside `vietduc24h.com`, you might get some security exception. In or...
Try this: ``` $("#content").html('<object data="http://vietduc24h.com">'); ``` Taken from [this answer](https://stackoverflow.com/a/9964050/646668).
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
It is always safe! (Math agrees with me.) The result of a mod operation is always less than the divisor. Since the result of a mod operation is essentially the remainder after performing integer division, you will never have a remainder larger than the divisor. I suspect the reason for having the operation return a ...
As Marc B alluded to, Java will promote `b` to a `long` before actually doing the `%` operation. This promotion applies to all the arithmetic operations, even `<<` and `>>` I believe. In other words, if you have a binary operation and the two arguments don't have the same type, the smaller one will be promoted so that...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
For most (if not all) arithmetic operations, Java will assume you want the maximum defined precision. Imagine if you did this: ``` long a = ...; int b = ...; long c = a % b + Integer.MAX_VALUE; ``` If Java automatically down-casted `a % b` to an `int`, then the above code would cause an `int` overflow rather than s...
It is always safe! (Math agrees with me.) The result of a mod operation is always less than the divisor. Since the result of a mod operation is essentially the remainder after performing integer division, you will never have a remainder larger than the divisor. I suspect the reason for having the operation return a ...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
It is always safe! (Math agrees with me.) The result of a mod operation is always less than the divisor. Since the result of a mod operation is essentially the remainder after performing integer division, you will never have a remainder larger than the divisor. I suspect the reason for having the operation return a ...
> > does any one know why Java has a longer type for % than needed? > > > I don't know for sure. Maybe to make it work exactly the same way as the other multiplicative operators: `*` and `\`. In the [JLS](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.17) `The type of a multiplicative ex...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
It is always safe! (Math agrees with me.) The result of a mod operation is always less than the divisor. Since the result of a mod operation is essentially the remainder after performing integer division, you will never have a remainder larger than the divisor. I suspect the reason for having the operation return a ...
This is a late party chime-in but the reason is pretty simple: The bytecode operands do need explicit casts (`L2I`) and longs need 2 stack positions compared to 1 for int, char, short, byte [casting from byte to int doesn't need a bytecode instruction]. After the mod operation the result takes 2 positions on the top ...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
For most (if not all) arithmetic operations, Java will assume you want the maximum defined precision. Imagine if you did this: ``` long a = ...; int b = ...; long c = a % b + Integer.MAX_VALUE; ``` If Java automatically down-casted `a % b` to an `int`, then the above code would cause an `int` overflow rather than s...
As Marc B alluded to, Java will promote `b` to a `long` before actually doing the `%` operation. This promotion applies to all the arithmetic operations, even `<<` and `>>` I believe. In other words, if you have a binary operation and the two arguments don't have the same type, the smaller one will be promoted so that...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
As Marc B alluded to, Java will promote `b` to a `long` before actually doing the `%` operation. This promotion applies to all the arithmetic operations, even `<<` and `>>` I believe. In other words, if you have a binary operation and the two arguments don't have the same type, the smaller one will be promoted so that...
> > does any one know why Java has a longer type for % than needed? > > > I don't know for sure. Maybe to make it work exactly the same way as the other multiplicative operators: `*` and `\`. In the [JLS](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.17) `The type of a multiplicative ex...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
For most (if not all) arithmetic operations, Java will assume you want the maximum defined precision. Imagine if you did this: ``` long a = ...; int b = ...; long c = a % b + Integer.MAX_VALUE; ``` If Java automatically down-casted `a % b` to an `int`, then the above code would cause an `int` overflow rather than s...
> > does any one know why Java has a longer type for % than needed? > > > I don't know for sure. Maybe to make it work exactly the same way as the other multiplicative operators: `*` and `\`. In the [JLS](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.17) `The type of a multiplicative ex...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
For most (if not all) arithmetic operations, Java will assume you want the maximum defined precision. Imagine if you did this: ``` long a = ...; int b = ...; long c = a % b + Integer.MAX_VALUE; ``` If Java automatically down-casted `a % b` to an `int`, then the above code would cause an `int` overflow rather than s...
This is a late party chime-in but the reason is pretty simple: The bytecode operands do need explicit casts (`L2I`) and longs need 2 stack positions compared to 1 for int, char, short, byte [casting from byte to int doesn't need a bytecode instruction]. After the mod operation the result takes 2 positions on the top ...
7,262,136
![http://farm4.static.flickr.com/3338/4564960137_0d3c09192d_o.png](https://i.stack.imgur.com/Y2gpf.png) can we change text in this lightbox want to change "This site requires that you Connect with Facebook." and "Connect with Facebook to Continue"
2011/08/31
[ "https://Stackoverflow.com/questions/7262136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922283/" ]
This is a late party chime-in but the reason is pretty simple: The bytecode operands do need explicit casts (`L2I`) and longs need 2 stack positions compared to 1 for int, char, short, byte [casting from byte to int doesn't need a bytecode instruction]. After the mod operation the result takes 2 positions on the top ...
> > does any one know why Java has a longer type for % than needed? > > > I don't know for sure. Maybe to make it work exactly the same way as the other multiplicative operators: `*` and `\`. In the [JLS](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.17) `The type of a multiplicative ex...
45,507,197
This is about converting the enumeration values to a string array. I have an enumeration: ``` enum Weather { RAINY, SUNNY, STORMY } ``` And I want to convert this to a string array with minimal effort and no loops with Java 8+. This is the best I came up with: ``` Arrays.stream(Weather.values()).map(Enum::toStr...
2017/08/04
[ "https://Stackoverflow.com/questions/45507197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2735286/" ]
Original post ============= Yes, that's a good Java 8 way, but... The `toString` can be overridden, so you'd better go with `Weather::name` which returns the name of an enum constant (exactly as declared in the enum declaration) and can't be changed: ``` Stream.of(Weather.values()).map(Weather::name).toArray(String[...
If you're frequently converting enum values to any kind of array you can as well precompute it values as static field: ``` enum Weather { RAINY, SUNNY, STORMY; public static final String[] STRINGS = Arrays.stream(Weather.values()) .map(Enum::name) ...
26,351
I was studying for icing and a tailplane stall. I have looked up some internet pages and instrument flying handbook, and found the procedure below. 1. raise flaps to the previous setting. (To reduce down wash from the main wing so that reducing negative angle of attack of the tail and break the stall) 2. apply nose up...
2016/03/23
[ "https://aviation.stackexchange.com/questions/26351", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/6831/" ]
Lets start with the very basic concepts.... In most aircraft, the Centre of Gravity (cg) is somewhat forward of the wing or mainplane Centre of Pressure. The exact distance between the cg and the Centre of pressure will depend on aircraft loading, configuration, thrust setting and drag. However, cg forward of the Cent...
There was a NASA report on the [NASA/FAA Tailplane Icing Program Overview](http://ntrs.nasa.gov/search.jsp?R=19990019485&hterms=19990019485&qs=Ntk%3DDocument-ID%26Ntt%3D19990019485%26N%3D0), which covers the points raised by you. It lists certain actions that can be done to recover from a tail plane stall: > > When t...
26,351
I was studying for icing and a tailplane stall. I have looked up some internet pages and instrument flying handbook, and found the procedure below. 1. raise flaps to the previous setting. (To reduce down wash from the main wing so that reducing negative angle of attack of the tail and break the stall) 2. apply nose up...
2016/03/23
[ "https://aviation.stackexchange.com/questions/26351", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/6831/" ]
Lets start with the very basic concepts.... In most aircraft, the Centre of Gravity (cg) is somewhat forward of the wing or mainplane Centre of Pressure. The exact distance between the cg and the Centre of pressure will depend on aircraft loading, configuration, thrust setting and drag. However, cg forward of the Cent...
For those recommended actions to be effective, two preconditions have been quietly assumed: 1. The tail surface produces downward lift and 2. The wing has positive camber. Both can be assumed to be correct in almost any case. Now let’s look at the three recommendations in detail: > > raise flaps to the previous set...
26,351
I was studying for icing and a tailplane stall. I have looked up some internet pages and instrument flying handbook, and found the procedure below. 1. raise flaps to the previous setting. (To reduce down wash from the main wing so that reducing negative angle of attack of the tail and break the stall) 2. apply nose up...
2016/03/23
[ "https://aviation.stackexchange.com/questions/26351", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/6831/" ]
Lets start with the very basic concepts.... In most aircraft, the Centre of Gravity (cg) is somewhat forward of the wing or mainplane Centre of Pressure. The exact distance between the cg and the Centre of pressure will depend on aircraft loading, configuration, thrust setting and drag. However, cg forward of the Cent...
I have a theory on applying the backstick on a tail stall induced while lowering the flaps. OP’s comment: > > apply nose up elevator pressure (I don't get it. The nose up pressure will make the elevator to go up and wouldn't this increase the negative angle of attack and worsen the stall?) > > > If the tail stall...
26,351
I was studying for icing and a tailplane stall. I have looked up some internet pages and instrument flying handbook, and found the procedure below. 1. raise flaps to the previous setting. (To reduce down wash from the main wing so that reducing negative angle of attack of the tail and break the stall) 2. apply nose up...
2016/03/23
[ "https://aviation.stackexchange.com/questions/26351", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/6831/" ]
There was a NASA report on the [NASA/FAA Tailplane Icing Program Overview](http://ntrs.nasa.gov/search.jsp?R=19990019485&hterms=19990019485&qs=Ntk%3DDocument-ID%26Ntt%3D19990019485%26N%3D0), which covers the points raised by you. It lists certain actions that can be done to recover from a tail plane stall: > > When t...
For those recommended actions to be effective, two preconditions have been quietly assumed: 1. The tail surface produces downward lift and 2. The wing has positive camber. Both can be assumed to be correct in almost any case. Now let’s look at the three recommendations in detail: > > raise flaps to the previous set...
26,351
I was studying for icing and a tailplane stall. I have looked up some internet pages and instrument flying handbook, and found the procedure below. 1. raise flaps to the previous setting. (To reduce down wash from the main wing so that reducing negative angle of attack of the tail and break the stall) 2. apply nose up...
2016/03/23
[ "https://aviation.stackexchange.com/questions/26351", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/6831/" ]
There was a NASA report on the [NASA/FAA Tailplane Icing Program Overview](http://ntrs.nasa.gov/search.jsp?R=19990019485&hterms=19990019485&qs=Ntk%3DDocument-ID%26Ntt%3D19990019485%26N%3D0), which covers the points raised by you. It lists certain actions that can be done to recover from a tail plane stall: > > When t...
I have a theory on applying the backstick on a tail stall induced while lowering the flaps. OP’s comment: > > apply nose up elevator pressure (I don't get it. The nose up pressure will make the elevator to go up and wouldn't this increase the negative angle of attack and worsen the stall?) > > > If the tail stall...
2,093,466
I understand that division by zero isn't allowed, but we merely just multiplied $f(x) = 1$ by $\frac{x-1}{x-1}$ to get $f(x) = \frac{x-1}{x-1}$ and $a\cdot 1 = 1\cdot a = a$ so they're the **same function** but with **different domain** how is this possible? *Or in other words* why don't we simplify $f(x) = \frac{x-1}...
2017/01/11
[ "https://math.stackexchange.com/questions/2093466", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406041/" ]
They are the same *almost everywhere*. But clearly one of them does not exist for $x=1$ (since "$\tfrac{0}{0}$" is undefined), while the other one is simply $1$ at $x=1$. > > I understand that division by zero isn't allowed, but we merely just multiplied f(x) = 1 by (x-1)/(x-1) > > > You can multiply by any fract...
**Question**: What is a function? **Answer**: Maybe simply said it is a map (receipe), $f(x)$, that projects some elements, $x$, contained in a specifically defined set, Domain $D$, into another set, Range $R$. **Discussion**: Hence when defining a function one must define the Domain as well as the functional form. ...
2,093,466
I understand that division by zero isn't allowed, but we merely just multiplied $f(x) = 1$ by $\frac{x-1}{x-1}$ to get $f(x) = \frac{x-1}{x-1}$ and $a\cdot 1 = 1\cdot a = a$ so they're the **same function** but with **different domain** how is this possible? *Or in other words* why don't we simplify $f(x) = \frac{x-1}...
2017/01/11
[ "https://math.stackexchange.com/questions/2093466", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406041/" ]
They are the same *almost everywhere*. But clearly one of them does not exist for $x=1$ (since "$\tfrac{0}{0}$" is undefined), while the other one is simply $1$ at $x=1$. > > I understand that division by zero isn't allowed, but we merely just multiplied f(x) = 1 by (x-1)/(x-1) > > > You can multiply by any fract...
$f(x)=(x-1)/(x-1)$ does not have a value when $x=1$, different thing happens to $f(x)=1$
2,093,466
I understand that division by zero isn't allowed, but we merely just multiplied $f(x) = 1$ by $\frac{x-1}{x-1}$ to get $f(x) = \frac{x-1}{x-1}$ and $a\cdot 1 = 1\cdot a = a$ so they're the **same function** but with **different domain** how is this possible? *Or in other words* why don't we simplify $f(x) = \frac{x-1}...
2017/01/11
[ "https://math.stackexchange.com/questions/2093466", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406041/" ]
**Question**: What is a function? **Answer**: Maybe simply said it is a map (receipe), $f(x)$, that projects some elements, $x$, contained in a specifically defined set, Domain $D$, into another set, Range $R$. **Discussion**: Hence when defining a function one must define the Domain as well as the functional form. ...
$f(x)=(x-1)/(x-1)$ does not have a value when $x=1$, different thing happens to $f(x)=1$
59,133,760
I have following HTML code ``` <div class="compatible-product ng-star-inserted"> <adapt-checkbox2 class="checkbox ng-valid ng-star-inserted ng-dirty ng-touched" ng-reflect-model="false"> <label class="checkbox__label" for= "adapt-checkbox-453-input"> <input class="checkbox__input" type="chec...
2019/12/02
[ "https://Stackoverflow.com/questions/59133760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189243/" ]
Basically, you are getting an **Array of Object** and you want to access the last element of the array, you can **get last array position by** `array.length - 1`, and access the gfs value. if you want to **check whether gfs value is array** not then you can **check by** `typeof gfs` ```js var data= [ { ...
You can access the array value by `index` so you can use loop to access it by index or you can directly access it using `index` number. Check out these docs. It will help out to better understand [Loops\_and\_iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration) [Array](https:...
59,133,760
I have following HTML code ``` <div class="compatible-product ng-star-inserted"> <adapt-checkbox2 class="checkbox ng-valid ng-star-inserted ng-dirty ng-touched" ng-reflect-model="false"> <label class="checkbox__label" for= "adapt-checkbox-453-input"> <input class="checkbox__input" type="chec...
2019/12/02
[ "https://Stackoverflow.com/questions/59133760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189243/" ]
Basically, you are getting an **Array of Object** and you want to access the last element of the array, you can **get last array position by** `array.length - 1`, and access the gfs value. if you want to **check whether gfs value is array** not then you can **check by** `typeof gfs` ```js var data= [ { ...
JSON.parse() gives JavaScript object. Here it is the Array object, so you can access it by looping the array or specifying the array index directly. ``` var data = [ { url: 'https://playy-test.s3.ap-south-1.amazonaws.com/hidden.mp4', typ: 'base', pos: 0, gfs: null ...
59,133,760
I have following HTML code ``` <div class="compatible-product ng-star-inserted"> <adapt-checkbox2 class="checkbox ng-valid ng-star-inserted ng-dirty ng-touched" ng-reflect-model="false"> <label class="checkbox__label" for= "adapt-checkbox-453-input"> <input class="checkbox__input" type="chec...
2019/12/02
[ "https://Stackoverflow.com/questions/59133760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189243/" ]
Basically, you are getting an **Array of Object** and you want to access the last element of the array, you can **get last array position by** `array.length - 1`, and access the gfs value. if you want to **check whether gfs value is array** not then you can **check by** `typeof gfs` ```js var data= [ { ...
Accessed it by using `console.log(obj.data[3].gfs)` I didn't take into account that the data key stored inside data inside obj(which I assigned)/
299,700
I was following [this tutorial](https://www.youtube.com/watch?v=lrvLnhm6Rqw&list=PLpVC00PAQQxHi-llE9Z8-Q747NYWpsq6t&index=32) on Drupal module development. It talks about database query joins in module development. The tutorial is made for Drupal 8 and I'm using Drupal 9. Then I made this (look at the join part): ```...
2021/01/25
[ "https://drupal.stackexchange.com/questions/299700", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/102226/" ]
In PHP: * `.` is the string concatenation operator, not the one to call an object method * [`join()`](https://www.php.net/manual/en/function.join.php) is an alias for the [`implode()`](https://www.php.net/manual/en/function.implode.php) function, which effectively requires 2 arguments, not 3 This means that `$select....
Solution: In Drupal 9, I needed to replace joins so it works: ``` //$select.join('users_field_data', 'u', 'r.uid = u.uid'); $select->addJoin('inner','users_field_data','u','r.uid = u.uid'); //$select->join('node_field_data', 'n', 'r.nid = n.nid'); $select->addJoin('inner','node_field_data','n','r.nid = n.nid'); ```
74,243,879
I want to use UTC dates in my Node.js backend app, however, I need to be able to set time (hours and minutes) in a local/user-specified timezone. I am looking for a solution in either pure JS or using `dayjs`. I am not looking for a solution in `moment`. It seemed like using `dayjs` I could solve this problem quite e...
2022/10/29
[ "https://Stackoverflow.com/questions/74243879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3408342/" ]
I created the following function that sets the time in a local timezone, for example, if you have `Date` object and you want to change its time (but not date in a particular timezone, regardless of the UTC date of that time), you provide this function with that `Date` object, the required time, timezone and optionally ...
In JavaScript the `Date` objects usually expect time definitions in the local (browser) time and store it in UTC time. You can explicitly set a time in the UTC timezone with the `.setUTC<time part>()` methods. You can set the time `hours` for the timezone GMT+2 by using the `.setUTCHours()` function with an argument of...
74,243,879
I want to use UTC dates in my Node.js backend app, however, I need to be able to set time (hours and minutes) in a local/user-specified timezone. I am looking for a solution in either pure JS or using `dayjs`. I am not looking for a solution in `moment`. It seemed like using `dayjs` I could solve this problem quite e...
2022/10/29
[ "https://Stackoverflow.com/questions/74243879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3408342/" ]
The following follows your method of getting the date and offset in the target timezone then using it with the time parts to generate a timestamp that is parsed by the built–in parser. It doesn't fix the issue of the initial date and the result crossing an offset (likely DST), it's just a bit less code. You really sho...
In JavaScript the `Date` objects usually expect time definitions in the local (browser) time and store it in UTC time. You can explicitly set a time in the UTC timezone with the `.setUTC<time part>()` methods. You can set the time `hours` for the timezone GMT+2 by using the `.setUTCHours()` function with an argument of...
199,880
Is there any way to show a calculated field when I'm filling out a new item for a list? For example: If I select "Blue" in field1, and "Bird" in field2, then, on the same page where I am filling in information, I can see field3(Calculated field) show a value of "Blue Jay" Currently, the calculated field doesn't sho...
2016/11/17
[ "https://sharepoint.stackexchange.com/questions/199880", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/61825/" ]
**As a short answer** : unfortunately , No, the calculated field is calculated after the item added or updated If you are using Enterprise Edition of SharePoint then try editing list form with InfoPath and insert field which will do the calculation for you. Make that field read-only and then publish the form. In Inf...
Calculated columns don't work that way, they are visible on the display form only or in views and only recalculate when items are edited. If you want that type of preview feature, you'll have to incorporate custom javascript on your forms.
77,133
There seems to be a lot of software to control (or emulate) mouse input through the keyboard, but what about the opposite? Basically I'm looking for a way to emulate up/down/left/right clicks with mouse movement, at a fast rate (i.e. lots of very short and quick right clicks while I move the mouse to the right) If I ...
2009/11/30
[ "https://superuser.com/questions/77133", "https://superuser.com", "https://superuser.com/users/19668/" ]
OK, hopefully supplying a *useful* answer this time, instead of the inverse of the actual answer you wanted... How about an AutoHotkey script for [mouse gestures](http://www.autohotkey.com/docs/scripts/MouseGestures.htm)? You haven't indicated what sort of control you require, so perhaps a set of gestures is adequate....
If you want something where you can type with your mouse, then I suggest you take a look at [Dasher](http://www.inference.phy.cam.ac.uk/dasher/). That is, if I take your question title as the question. As I really don't quite understand your question.
77,133
There seems to be a lot of software to control (or emulate) mouse input through the keyboard, but what about the opposite? Basically I'm looking for a way to emulate up/down/left/right clicks with mouse movement, at a fast rate (i.e. lots of very short and quick right clicks while I move the mouse to the right) If I ...
2009/11/30
[ "https://superuser.com/questions/77133", "https://superuser.com", "https://superuser.com/users/19668/" ]
If you're on Windows, what about the On-Screen Keyboard? It's found under **All Programs -> Accessories -> Accessibility** on XP (similar for Vista+) ![alt text](https://i.stack.imgur.com/nPFOE.png)
If you want something where you can type with your mouse, then I suggest you take a look at [Dasher](http://www.inference.phy.cam.ac.uk/dasher/). That is, if I take your question title as the question. As I really don't quite understand your question.
77,133
There seems to be a lot of software to control (or emulate) mouse input through the keyboard, but what about the opposite? Basically I'm looking for a way to emulate up/down/left/right clicks with mouse movement, at a fast rate (i.e. lots of very short and quick right clicks while I move the mouse to the right) If I ...
2009/11/30
[ "https://superuser.com/questions/77133", "https://superuser.com", "https://superuser.com/users/19668/" ]
OK, hopefully supplying a *useful* answer this time, instead of the inverse of the actual answer you wanted... How about an AutoHotkey script for [mouse gestures](http://www.autohotkey.com/docs/scripts/MouseGestures.htm)? You haven't indicated what sort of control you require, so perhaps a set of gestures is adequate....
If you're on Windows, what about the On-Screen Keyboard? It's found under **All Programs -> Accessories -> Accessibility** on XP (similar for Vista+) ![alt text](https://i.stack.imgur.com/nPFOE.png)
95,407
I was playing some math games intended for children, in Japanese, and the subject was 引き算. The isolated question came up "14は10といくつ?" In the context of 引き算 it makes sense that the answer turned out to be 4, but I don't understand the question structurally. How does it imply "If you take 10 away from 14, what's left?" ...
2022/07/15
[ "https://japanese.stackexchange.com/questions/95407", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/41549/" ]
> > Is this to be understood only in the context? Assuming the と is conditional > > > The と is not conditional, and you can tell that from the word followed by the と. **The conditional と should follow 活用語の終止形/the terminal form of a conjugatable word**, such as verb, i/na-adjective, auxiliary, eg 「話す」「寒い」「静かだ」「〇〇だ...
I think it is an odd way to ask, but the structure is: * 14 は 10 と いくつ * 14 = 10 + ? so that it is essentially a subtraction. Grammatically, は is the subject marker and と is *and* (In words, *14 is 10 and how many?*)
57,779,158
I am using material-ui for my project and I have a need to get the selected text (not the value) and do some parsing. I can't seem to find a way to do this. Here is what my component looks like: ``` <TextField select margin="dense" ...
2019/09/03
[ "https://Stackoverflow.com/questions/57779158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8484824/" ]
This regex match should get you what you're looking for ```js let regex = /1-[0-9]{3}-[0-9]{3}-[0-9]{4}/ ```
Try ``` let candidateValue = getMeSomeValue(); const isValid = (candidateValue || "").match( /^1-[0-9]{3}-[0-9]{4}$/ ); ``` Add `\s` following the `^` and before the `$` if you want to play nice and ignore leading/trailing whitespace.
195,501
Is it coherent to suggest that it is possible to iterate, one-by-one, through every single item in an infinite set? Some have suggested that it is possible to iterate (or count) completely through an infinite set with no start (or lower bound), making infinite regress a genuinely possible reality. Mathematically, is t...
2012/09/14
[ "https://math.stackexchange.com/questions/195501", "https://math.stackexchange.com", "https://math.stackexchange.com/users/40191/" ]
We may count through the integers by listing them $0,1,-1,2,-2,\dots$. This is an infinite set without a lower bound. In general, if you have a bijection $f:\mathbb{N} \to X$ where $X$ is an infinite set, then you can "iterate" through them by listing $f(1),f(2),f(3), \dots$.
Here is a way to iterate... To me, it is like mixing math and computers. You can find the ideas described in much more detail in [Generatingfunctionology by Wilf](http://www.math.upenn.edu/~wilf/gfology2.pdf). Knowing Calculus is very helpful for this. Let me explain. We would like to iterate through infinity and stop...
69,581,492
I have string column in my `df` table, like this below: ``` d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3']} df = pd.DataFrame(data=d) df ``` [![enter image description here](https://i.stack.imgur.com/X2WXJ.png)](https://i.stack.imgur.com/X2WXJ.png) I would like to convert this column, so that all val...
2021/10/15
[ "https://Stackoverflow.com/questions/69581492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16734748/" ]
Like this: ``` df['col1'] = df['col1'].astype(float).map('{:,.2f}'.format).astype(str) ``` If you have '' in this column you better replace them before to '0'.
This one will work no matter how many columns are in your dictionary. Try this: ```py d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9' '', '2.3']} for x in d: for y in range(0,len(d[x])): d[x][y]=d[x][y].ljust(4,"0") print(d) ```
69,581,492
I have string column in my `df` table, like this below: ``` d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3']} df = pd.DataFrame(data=d) df ``` [![enter image description here](https://i.stack.imgur.com/X2WXJ.png)](https://i.stack.imgur.com/X2WXJ.png) I would like to convert this column, so that all val...
2021/10/15
[ "https://Stackoverflow.com/questions/69581492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16734748/" ]
Use [`str.ljust`](https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ljust.html): ``` df['col1'] = df['col1'].str.ljust(4, '0') ``` output: ``` col1 0 1.20 1 3.40 2 1.99 3 0.14 4 2.90 5 2.30 ``` To leave empty rows intact: ``` df['col1'] = df['col1'].mask(df['col1'].astype(bool), df['col1']....
Like this: ``` df['col1'] = df['col1'].astype(float).map('{:,.2f}'.format).astype(str) ``` If you have '' in this column you better replace them before to '0'.
69,581,492
I have string column in my `df` table, like this below: ``` d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3']} df = pd.DataFrame(data=d) df ``` [![enter image description here](https://i.stack.imgur.com/X2WXJ.png)](https://i.stack.imgur.com/X2WXJ.png) I would like to convert this column, so that all val...
2021/10/15
[ "https://Stackoverflow.com/questions/69581492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16734748/" ]
Like this: ``` df['col1'] = df['col1'].astype(float).map('{:,.2f}'.format).astype(str) ``` If you have '' in this column you better replace them before to '0'.
You can easily use the `round` or `format` function. In your specific case, using `format`, you can write something like this: ``` d = ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3'] for i in range(len(d)): if d[i] == '': d[i] = '0' d[i] = "{:.2f}".format(float(d[i])) print ('col1', d) ``` o...
69,581,492
I have string column in my `df` table, like this below: ``` d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3']} df = pd.DataFrame(data=d) df ``` [![enter image description here](https://i.stack.imgur.com/X2WXJ.png)](https://i.stack.imgur.com/X2WXJ.png) I would like to convert this column, so that all val...
2021/10/15
[ "https://Stackoverflow.com/questions/69581492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16734748/" ]
Use [`str.ljust`](https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ljust.html): ``` df['col1'] = df['col1'].str.ljust(4, '0') ``` output: ``` col1 0 1.20 1 3.40 2 1.99 3 0.14 4 2.90 5 2.30 ``` To leave empty rows intact: ``` df['col1'] = df['col1'].mask(df['col1'].astype(bool), df['col1']....
This one will work no matter how many columns are in your dictionary. Try this: ```py d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9' '', '2.3']} for x in d: for y in range(0,len(d[x])): d[x][y]=d[x][y].ljust(4,"0") print(d) ```
69,581,492
I have string column in my `df` table, like this below: ``` d = {'col1': ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3']} df = pd.DataFrame(data=d) df ``` [![enter image description here](https://i.stack.imgur.com/X2WXJ.png)](https://i.stack.imgur.com/X2WXJ.png) I would like to convert this column, so that all val...
2021/10/15
[ "https://Stackoverflow.com/questions/69581492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16734748/" ]
Use [`str.ljust`](https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ljust.html): ``` df['col1'] = df['col1'].str.ljust(4, '0') ``` output: ``` col1 0 1.20 1 3.40 2 1.99 3 0.14 4 2.90 5 2.30 ``` To leave empty rows intact: ``` df['col1'] = df['col1'].mask(df['col1'].astype(bool), df['col1']....
You can easily use the `round` or `format` function. In your specific case, using `format`, you can write something like this: ``` d = ['1.2', '3.4', '1.99', '0.14', '2.9', '', '2.3'] for i in range(len(d)): if d[i] == '': d[i] = '0' d[i] = "{:.2f}".format(float(d[i])) print ('col1', d) ``` o...
2,435,039
Sorry the title's so convoluted... I must've tried for ten minutes to get a good, descriptive title! Basically, here's the scenario. Let's say a user can pick fifty different hat colors and styles to put on an avatar. The avatar can move his head around, so we'd need the same types of movements in the symbol for when...
2010/03/12
[ "https://Stackoverflow.com/questions/2435039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48957/" ]
[debu's suggestion](https://stackoverflow.com/questions/2435039/best-way-to-be-able-to-pick-multiple-colors-designs-of-symbols-dynamically-from-f/2435101#2435101) about a hat container makes sense in order to separate out control of the hat movement. You could take this further by separating out different aspects of t...
You could do that a number of ways; firstly you could have each different hat as a different symbol in the Flash Library (if you're using the IDE), and then in their properties tick to 'Export for Actionscript', and choose some appropriate name. It'll tell you that there's no definition for the class path, and one will...
26,678,924
I'm writing a Linux device driver using kernel 3.13.0 and I'm confused as to why I'm getting this warning. ``` warning: initialization from incompatible pointer type [enabled by default] .read = read_proc, ^ warning: (near initialization for ‘proc_fops.read’) [enabled by default] ``` As far as I can tell m...
2014/10/31
[ "https://Stackoverflow.com/questions/26678924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289746/" ]
The return type of your `read_proc` function (which throws the warning) does not match the the function that compiles cleanly. ``` static ssize_t dev_read(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off) ``` vs. ``` static int read_proc(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off...
The function pointer expects a function with return type of `ssize_t` but you've given it one of `int` You need a `ssize_t` there, not an `int`.
26,678,924
I'm writing a Linux device driver using kernel 3.13.0 and I'm confused as to why I'm getting this warning. ``` warning: initialization from incompatible pointer type [enabled by default] .read = read_proc, ^ warning: (near initialization for ‘proc_fops.read’) [enabled by default] ``` As far as I can tell m...
2014/10/31
[ "https://Stackoverflow.com/questions/26678924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289746/" ]
While working with file operations just follow rules according to this structure ``` struct file_operations { struct module *owner; loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); ssize_t (*write) (struct file *, const char __user *, size...
The function pointer expects a function with return type of `ssize_t` but you've given it one of `int` You need a `ssize_t` there, not an `int`.
26,678,924
I'm writing a Linux device driver using kernel 3.13.0 and I'm confused as to why I'm getting this warning. ``` warning: initialization from incompatible pointer type [enabled by default] .read = read_proc, ^ warning: (near initialization for ‘proc_fops.read’) [enabled by default] ``` As far as I can tell m...
2014/10/31
[ "https://Stackoverflow.com/questions/26678924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289746/" ]
The return type of your `read_proc` function (which throws the warning) does not match the the function that compiles cleanly. ``` static ssize_t dev_read(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off) ``` vs. ``` static int read_proc(struct file *pfil, char __user *pBuf, size_t len, loff_t *p_off...
While working with file operations just follow rules according to this structure ``` struct file_operations { struct module *owner; loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); ssize_t (*write) (struct file *, const char __user *, size...
8,499
I am writing an application, running on a server, where multiple users access data from a database which is AES encrypted with a master secret. The master secret itself is initially randomly generated, and then AES encrypted with a user-secret to yield a 'user-hash'. The master secret is never stored, but the user-hash...
2013/05/30
[ "https://crypto.stackexchange.com/questions/8499", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/7065/" ]
If a user has a copy of both the encrypted and decrypted data, he is in a position to perform at least a [known-plaintext attack](http://en.wikipedia.org/wiki/Known-plaintext_attack). If users can submit arbitrary plaintexts for encryption, they can conduct a [chosen-plaintext attack](http://en.wikipedia.org/wiki/Chose...
Your master secret is **never** secure, at least not as you have described it. As a user, I know my private secret. When I use your application, my private secret decrypts the master secret right there in the application. With modest technical skills, I can examine the memory of the process or machine and read the mast...
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
1. Feller's first volume for Probability Theory. 2. Arnold's ODE for differential equations. 3. Cartan's Elementary Theory of Analytic Functions of One or Several Complex Variables for Complex Analysis
It's a bit more advanced than the topics you asked about, but Milnor's *Morse Theory* and Milnor and Stasheff's *Characteristic Classes* are astoundingly good. (There's a pattern here: Milnor's *Lectures on the h-Cobordism Theorem* is pretty good too!) At a somewhat lower level, I find Spivak's *Calculus* (which many ...
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I don’t agree with Bell on this point: one may well learn better and more easily from a book that is *not* generally considered a classic. For example, most people have never even heard of John Greever’s modified Moore method textbook *Theory and Examples of Point-Set Topology*, but for me it was the ideal introduction...
It's a bit more advanced than the topics you asked about, but Milnor's *Morse Theory* and Milnor and Stasheff's *Characteristic Classes* are astoundingly good. (There's a pattern here: Milnor's *Lectures on the h-Cobordism Theorem* is pretty good too!) At a somewhat lower level, I find Spivak's *Calculus* (which many ...
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
1. Feller's first volume for Probability Theory. 2. Arnold's ODE for differential equations. 3. Cartan's Elementary Theory of Analytic Functions of One or Several Complex Variables for Complex Analysis
The Mathematical Association of America (MAA) has got a rich collection of classic books under Doclani Mathematical Expositions. I would suggest you following: $1$. Mathematical Gems Series ($3$ Volumes) By Ross Honsburger. $2$. Linear Algebra problem book By Paul R Halmos. $3$. Euler: Master of us all By William Du...
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I don’t agree with Bell on this point: one may well learn better and more easily from a book that is *not* generally considered a classic. For example, most people have never even heard of John Greever’s modified Moore method textbook *Theory and Examples of Point-Set Topology*, but for me it was the ideal introduction...
The Mathematical Association of America (MAA) has got a rich collection of classic books under Doclani Mathematical Expositions. I would suggest you following: $1$. Mathematical Gems Series ($3$ Volumes) By Ross Honsburger. $2$. Linear Algebra problem book By Paul R Halmos. $3$. Euler: Master of us all By William Du...
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
1. Feller's first volume for Probability Theory. 2. Arnold's ODE for differential equations. 3. Cartan's Elementary Theory of Analytic Functions of One or Several Complex Variables for Complex Analysis
In the early '70s, I used two teaching books that I consider ''classic'': *Foundations of modern analysis* of J. Dieudonné (at least in Europe). *Algebra* of S. Mac Lane and G. Birkoff At a different level, I think that an ''evergreen'' is: *Methods of Mathematical physics* of R. Courant and D. Hilbert.
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I don’t agree with Bell on this point: one may well learn better and more easily from a book that is *not* generally considered a classic. For example, most people have never even heard of John Greever’s modified Moore method textbook *Theory and Examples of Point-Set Topology*, but for me it was the ideal introduction...
1. Feller's first volume for Probability Theory. 2. Arnold's ODE for differential equations. 3. Cartan's Elementary Theory of Analytic Functions of One or Several Complex Variables for Complex Analysis
2,055,713
In his book "Men of Mathematics", Eric Temple Bell repeatedly makes the point that a student of mathematics must read the classics. My question is what are some classic books in mathematics ( Dictionary definition : judged over a period of time to be of the highest quality and outstanding of its kind.) that can be use...
2016/12/12
[ "https://math.stackexchange.com/questions/2055713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I don’t agree with Bell on this point: one may well learn better and more easily from a book that is *not* generally considered a classic. For example, most people have never even heard of John Greever’s modified Moore method textbook *Theory and Examples of Point-Set Topology*, but for me it was the ideal introduction...
In the early '70s, I used two teaching books that I consider ''classic'': *Foundations of modern analysis* of J. Dieudonné (at least in Europe). *Algebra* of S. Mac Lane and G. Birkoff At a different level, I think that an ''evergreen'' is: *Methods of Mathematical physics* of R. Courant and D. Hilbert.
36,447,958
I'm using the [jQuery Validate Plugin](http://jqueryvalidation.org/validate) and I want to be able to hide the error messages next to my inputs and have a main error message at the bottom, I have this working kind of but the error messages are showing next to my input fields. (Obviously I would clean up the styling if ...
2016/04/06
[ "https://Stackoverflow.com/questions/36447958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4532646/" ]
May be use the Validator method ``` errorPlacement: function(error,element) { return true; } ``` It will not append the error to the inputs.
You can hide the error messages with CSS: ``` span.error { display: none; } ```
36,447,958
I'm using the [jQuery Validate Plugin](http://jqueryvalidation.org/validate) and I want to be able to hide the error messages next to my inputs and have a main error message at the bottom, I have this working kind of but the error messages are showing next to my input fields. (Obviously I would clean up the styling if ...
2016/04/06
[ "https://Stackoverflow.com/questions/36447958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4532646/" ]
May be use the Validator method ``` errorPlacement: function(error,element) { return true; } ``` It will not append the error to the inputs.
Normally, `showErrors` will automatically suppress the default messages next to each input element. You're creating your own issue because **`.defaultShowErrors()` is the method for putting back the default messages**. Simply remove `this.defaultShowErrors()`... ``` showErrors: function(errorMap, errorList) { $...
9,994,676
I have checked out many pages but most of the tutorials and script return an error code with this type of JSON output. So how would I be able to extract the data from this JSON in Java?: ``` [ { "user":{"id":"1","username":"user1"}, "item_name":"item1", "custom_field":"custom1" }, { "user":{"id":...
2012/04/03
[ "https://Stackoverflow.com/questions/9994676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310575/" ]
If you want to use Gson, then first you declare classes for holding each element and sub elements: ``` public class MyUser { public String id; public String username; } public class MyElement { public MyUser user; public String item_name; public String custom_field; } ``` Then you declare an array of the ...
If your trying to serialize/deserialize json in Java I would recommend using Jackson. <http://jackson.codehaus.org/> Once you have Jackson downloaded you can deserialize the json strings to an object which matches the objects in JSON. Jackson provides annotations that can be attached to your class which make deserial...
9,994,676
I have checked out many pages but most of the tutorials and script return an error code with this type of JSON output. So how would I be able to extract the data from this JSON in Java?: ``` [ { "user":{"id":"1","username":"user1"}, "item_name":"item1", "custom_field":"custom1" }, { "user":{"id":...
2012/04/03
[ "https://Stackoverflow.com/questions/9994676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310575/" ]
If you want to use Gson, then first you declare classes for holding each element and sub elements: ``` public class MyUser { public String id; public String username; } public class MyElement { public MyUser user; public String item_name; public String custom_field; } ``` Then you declare an array of the ...
You could try JSON Simple <http://code.google.com/p/json-simple/> Example: ``` JSONParser jsonParser = new JSONParser(); JSONArray jsonArray = (JSONArray) jsonParser.parse(jsonDataString); for (int i = 0; i < jsonArray.size(); i++) { JSONObject obj = (JSONObject) jsonArray.get(i); //Access data with obj.g...
10,839
I am reading Novuum Lumen Chemicum with the help of Waite’s English translation. (<https://www.sacred-texts.com/alc/hm2/hm204.htm>) The following passage I cannot understand clearly. It seems that Waite had skipped this.(org.: Musaeum Hermeticum, Frankfurt, 1677, p.545 – page number misprinted as 454) > > Nos dum ill...
2019/05/24
[ "https://latin.stackexchange.com/questions/10839", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/2954/" ]
To supplement, I've located [a different published (i.e. professional) English translation](https://archive.org/details/alchymytakenouto00sedz): that of a Dr John French, published in 1674. Here's what he has to say [for this section](https://archive.org/details/alchymytakenouto00sedz/page/2): > > If *Hermes* himfelf...
Here's my translation of that whole section: > > *Si hoc revivisceret ipse Philosophorum pater Hermes,* > > If Hermes himself, father of philosophers, were to come back to life, > > > *& subtilis ingenii Geber,* > > and subtle-witted Jabir, > > > *cum profundissimo RAYMUNDO LULLIO,* > > along with t...
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
**Update:** In the meantime, GitLab have released a new version of their Docker Machine fork which upgrades the default AMI to Ubuntu 20.04. That means that upgrading Docker Machine to the latest version released by GitLab will fix the issue without changing your runner configuration. The latest release can be found [...
I had the same issue since yesterday. It could be related to GitLab releasing 15.0 with breaking changes (going `live on GitLab.com sometime between April 23 – May 22`) * <https://about.gitlab.com/blog/2022/04/18/gitlab-releases-15-breaking-changes/> * but there is no mention of missing `AMI` field to add to field `M...
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
**Update:** In the meantime, GitLab have released a new version of their Docker Machine fork which upgrades the default AMI to Ubuntu 20.04. That means that upgrading Docker Machine to the latest version released by GitLab will fix the issue without changing your runner configuration. The latest release can be found [...
Make sure to select an ami for Ubuntu and not Debian and that your aws account is subscribed to it What I did 1. subscribe in aws marketplace to a Ubuntu Amazon Image (Ubuntu 20.04 LTS - Focal) 2. select launch instance, choose the region, and copy the ami shown
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
**Update:** In the meantime, GitLab have released a new version of their Docker Machine fork which upgrades the default AMI to Ubuntu 20.04. That means that upgrading Docker Machine to the latest version released by GitLab will fix the issue without changing your runner configuration. The latest release can be found [...
As Moritz pointed out: Adding: ``` MachineOptions = [ "amazonec2-ami=ami-02584c1c9d05efa69", ] ``` solves the issue.
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
**Update:** In the meantime, GitLab have released a new version of their Docker Machine fork which upgrades the default AMI to Ubuntu 20.04. That means that upgrading Docker Machine to the latest version released by GitLab will fix the issue without changing your runner configuration. The latest release can be found [...
Just wanted to add as well, go [here](https://cloud-images.ubuntu.com/locator/ec2/) for the ubuntu that corresponds with your region. Amis are region specific
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
**Update:** In the meantime, GitLab have released a new version of their Docker Machine fork which upgrades the default AMI to Ubuntu 20.04. That means that upgrading Docker Machine to the latest version released by GitLab will fix the issue without changing your runner configuration. The latest release can be found [...
Using the new AMI worked for a bit but after sometime the /etc/gitlab-runner/config.toml reverted back to old configuration. All the changes made is gone and reset automatically. Anyone have any idea why the config.toml file revert back and how to prevent it ?
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
Make sure to select an ami for Ubuntu and not Debian and that your aws account is subscribed to it What I did 1. subscribe in aws marketplace to a Ubuntu Amazon Image (Ubuntu 20.04 LTS - Focal) 2. select launch instance, choose the region, and copy the ami shown
I had the same issue since yesterday. It could be related to GitLab releasing 15.0 with breaking changes (going `live on GitLab.com sometime between April 23 – May 22`) * <https://about.gitlab.com/blog/2022/04/18/gitlab-releases-15-breaking-changes/> * but there is no mention of missing `AMI` field to add to field `M...
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
Make sure to select an ami for Ubuntu and not Debian and that your aws account is subscribed to it What I did 1. subscribe in aws marketplace to a Ubuntu Amazon Image (Ubuntu 20.04 LTS - Focal) 2. select launch instance, choose the region, and copy the ami shown
As Moritz pointed out: Adding: ``` MachineOptions = [ "amazonec2-ami=ami-02584c1c9d05efa69", ] ``` solves the issue.
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
Make sure to select an ami for Ubuntu and not Debian and that your aws account is subscribed to it What I did 1. subscribe in aws marketplace to a Ubuntu Amazon Image (Ubuntu 20.04 LTS - Focal) 2. select launch instance, choose the region, and copy the ami shown
Just wanted to add as well, go [here](https://cloud-images.ubuntu.com/locator/ec2/) for the ubuntu that corresponds with your region. Amis are region specific
72,026,622
I have an array of objects: ``` this.array = [{name: null}, {name: null}, {name: null}] ``` and array of reservend names: ``` this.reserved = ["name2", "name3"] ``` I loop through array and try to set uniques name (not included inside `reserved` array) ``` for (let i = 0; i < array.length; i++) { this.setD...
2022/04/27
[ "https://Stackoverflow.com/questions/72026622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16078729/" ]
Make sure to select an ami for Ubuntu and not Debian and that your aws account is subscribed to it What I did 1. subscribe in aws marketplace to a Ubuntu Amazon Image (Ubuntu 20.04 LTS - Focal) 2. select launch instance, choose the region, and copy the ami shown
Using the new AMI worked for a bit but after sometime the /etc/gitlab-runner/config.toml reverted back to old configuration. All the changes made is gone and reset automatically. Anyone have any idea why the config.toml file revert back and how to prevent it ?
32,251,446
I am developing an Android application and I have trouvble making javascript work. Here is my main activity code : ``` protected void onCreate(Bundle savedInstanceState) { Log.i(TAG, "create LocalDialogActivity"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_local_d...
2015/08/27
[ "https://Stackoverflow.com/questions/32251446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3664585/" ]
Just add ``` webView.getSettings().setDomStorageEnabled(true); ```
From my usage of Android webview, check if you are at "default" zoom level. For instance, if you zoom in/out and then press a button, you cannot press it, but instead pan the zoom at the position you clicked. If that is not your issue, attemp the following: Check if the script is being read correctly. Do this by addi...
49,336,275
Prestashop 1.6 has some strange functions. One of them is: ``` \themes\my_theme\js\autoload\15-jquery.uniform-modified.js ``` Which add span to radio, input button. For example: ``` <div class="checker" id="uniform-cgv"> <span class="checked"> <input name="cgv" id="cgv" value="1" type="checkbox"> </span> <...
2018/03/17
[ "https://Stackoverflow.com/questions/49336275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9368657/" ]
If you want to get the same checkbox like with uniform you just need to invoke method bindUniform() after your button was handled. I assume that you get an answer after form handling with an ajax response, so you need to add `if (typeof bindUniform !=='undefined') { bindUniform(); }` after you get response and DOM ...
@Alexander Grosul Thanks again. To fix this issues You need to add this code to any js file. ``` $("select.form-control,input[type='radio'],input[type='checkbox']").uniform(); ```
12,023,986
Today I noticed that new MVC projects in VS 2012 are using [WebMatrix.WebData.WebSecurity](http://msdn.microsoft.com/en-us/library/webmatrix.webdata.websecurity%28v=vs.99%29.aspx) to handle membership related tasks. I went to msdn to a quick look at the documentation and was surprised. Lot's of good stuff in there and...
2012/08/19
[ "https://Stackoverflow.com/questions/12023986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1061342/" ]
Found the answer at MSDN: <http://msdn.microsoft.com/en-us/library/webmatrix.webdata.simplemembershipprovider%28v=vs.111%29> > > In ASP.NET Web Pages sites, you can access the functionality of the SimpleMembershipProvider class by using the Membership property of a web page. You do not (in fact, cannot) initialize a ...
`((SimpleMembershipProvider)Membership.Provider).DeleteAccount("UserName");` //This will remove entry from **[webpages\_Membership]** table `Roles.RemoveUserFromRole("UserName", "RoleName");` // This will remove from **[webpages\_UsersInRoles]** table `((SimpleMembershipProvider)Membership.Provider).DeleteUser("UserN...
12,023,986
Today I noticed that new MVC projects in VS 2012 are using [WebMatrix.WebData.WebSecurity](http://msdn.microsoft.com/en-us/library/webmatrix.webdata.websecurity%28v=vs.99%29.aspx) to handle membership related tasks. I went to msdn to a quick look at the documentation and was surprised. Lot's of good stuff in there and...
2012/08/19
[ "https://Stackoverflow.com/questions/12023986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1061342/" ]
``` ((SimpleMembershipProvider)Membership.Provider).DeleteAccount("username"); ((SimpleMembershipProvider)Membership.Provider).DeleteUser("username", true); ```
`((SimpleMembershipProvider)Membership.Provider).DeleteAccount("UserName");` //This will remove entry from **[webpages\_Membership]** table `Roles.RemoveUserFromRole("UserName", "RoleName");` // This will remove from **[webpages\_UsersInRoles]** table `((SimpleMembershipProvider)Membership.Provider).DeleteUser("UserN...
60,655,194
everyone! I am trying to render the exchange rates from a server to my page. Here is my React code: ``` import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { constructor() { super(); this.state = { exRates: [] }; } getCurrency...
2020/03/12
[ "https://Stackoverflow.com/questions/60655194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11894807/" ]
1. You must not had an empty line beetween `@app.route("/profile/<name>")` and `def profile(name):` 2. You have to set the html file in a folder called templates. 3. You have to set the templates folder and run.py in the same folder
You can try this below by adding the type string in your @app.route : ``` @app.route("/profile/<string:name>") def profile(name): return render_template("test.html", name=name) ```
60,655,194
everyone! I am trying to render the exchange rates from a server to my page. Here is my React code: ``` import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { constructor() { super(); this.state = { exRates: [] }; } getCurrency...
2020/03/12
[ "https://Stackoverflow.com/questions/60655194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11894807/" ]
Whenever we receive 500 internal server error on a Python wsgi application we can log it using 'logging' First import `from logging import FileHandler,WARNING` then after `app = Flask(__name__, template_folder = 'template')` add ``` file_handler = FileHandler('errorlog.txt') file_handler.setLevel(WARNING) ``` Then...
You can try this below by adding the type string in your @app.route : ``` @app.route("/profile/<string:name>") def profile(name): return render_template("test.html", name=name) ```
35,285,191
I am executing a stored procedure but it is failing at some point, Current error code is not helping me to find where and exactly what the error is I wanted to know where it is exactly failing so wanted to print line by line output while executing. for eg : ``` create or replace -- decaring required variabl...
2016/02/09
[ "https://Stackoverflow.com/questions/35285191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1767969/" ]
Your code will look like this; additionally you can write a procedure with autonomous transactions to log all error or logs. you will also get online code for this functionality. [http://log4plsql.sourceforge.net/](http://logs) ``` create or replace procedure proc_data_table_details is tablename varchar2(30); ...
Try to break the code to few segements. That way you will narrow down your search field. Becoz what you are trying to do is take an analytical decision about when to print. Alternatively, if u want to print after every value assignment, you can parse the PL/SQL code as long to a variable and then loop over it until nex...
29,908,287
I need help with my program. I declared a one-dimensional array of 6 and I want to show random values between 1-6 in a text box My question is how do I show values in my array in textbox1.text? Here is my code: ``` Public Sub ClickMyFirstClassButton() If FirstClass.Checked = True Then 'This piece of co...
2015/04/28
[ "https://Stackoverflow.com/questions/29908287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4601982/" ]
As suggested by @eryksun, this solves the issue: ``` p = subprocess.Popen('clip.exe', stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True) p.communicate('hello \n world') p.wait() ```
I suspect it's because you're using `shell=True`, refactor your code to not use it. But I would suggest abandoning this approach alltogether and use [pyperclip](https://pypi.python.org/pypi/pyperclip/) for the clipboard support. It's cross-platform and freely available.
11,881,490
In a C# enumeration, are there any negative side effects of using a negative number? I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this. ``` public enum ResponseCodes { InvalidServerUserPasswordCombo = -1, // etc. } ...
2012/08/09
[ "https://Stackoverflow.com/questions/11881490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64226/" ]
> > negative side effects of using a negative number > > > Clearly, with any underlying signed type, any bitwise operations are going to get "interesting" very quickly. But using an enum as a collection of related constants can quite happily use negative values.
There's no negative side effects, however, keep in mind that an enum gets initialized to zero in this instance: ``` class YourClass { public ResponseCodes ResponseCode { get; set; } } ``` Providing just negative one will have an undesired impact for any users of the class (unless they initialize it.
11,881,490
In a C# enumeration, are there any negative side effects of using a negative number? I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this. ``` public enum ResponseCodes { InvalidServerUserPasswordCombo = -1, // etc. } ...
2012/08/09
[ "https://Stackoverflow.com/questions/11881490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64226/" ]
> > negative side effects of using a negative number > > > Clearly, with any underlying signed type, any bitwise operations are going to get "interesting" very quickly. But using an enum as a collection of related constants can quite happily use negative values.
No, the enum is a value with an integer type and this can be any value from -2,147,483,648 to 2,147,483,647! :)
11,881,490
In a C# enumeration, are there any negative side effects of using a negative number? I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this. ``` public enum ResponseCodes { InvalidServerUserPasswordCombo = -1, // etc. } ...
2012/08/09
[ "https://Stackoverflow.com/questions/11881490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64226/" ]
> > negative side effects of using a negative number > > > Clearly, with any underlying signed type, any bitwise operations are going to get "interesting" very quickly. But using an enum as a collection of related constants can quite happily use negative values.
This answer is 7 years late but I haven't seen the point made anywhere else. There is a minor negative side effect when using negative numbers for enums. If you want to cast a negative number to an enum you'll need to ensure the number is in brackets to avoid a compile error, e.g.: ``` class YourClass { Response...
11,881,490
In a C# enumeration, are there any negative side effects of using a negative number? I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this. ``` public enum ResponseCodes { InvalidServerUserPasswordCombo = -1, // etc. } ...
2012/08/09
[ "https://Stackoverflow.com/questions/11881490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64226/" ]
There's no negative side effects, however, keep in mind that an enum gets initialized to zero in this instance: ``` class YourClass { public ResponseCodes ResponseCode { get; set; } } ``` Providing just negative one will have an undesired impact for any users of the class (unless they initialize it.
No, the enum is a value with an integer type and this can be any value from -2,147,483,648 to 2,147,483,647! :)
11,881,490
In a C# enumeration, are there any negative side effects of using a negative number? I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this. ``` public enum ResponseCodes { InvalidServerUserPasswordCombo = -1, // etc. } ...
2012/08/09
[ "https://Stackoverflow.com/questions/11881490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64226/" ]
There's no negative side effects, however, keep in mind that an enum gets initialized to zero in this instance: ``` class YourClass { public ResponseCodes ResponseCode { get; set; } } ``` Providing just negative one will have an undesired impact for any users of the class (unless they initialize it.
This answer is 7 years late but I haven't seen the point made anywhere else. There is a minor negative side effect when using negative numbers for enums. If you want to cast a negative number to an enum you'll need to ensure the number is in brackets to avoid a compile error, e.g.: ``` class YourClass { Response...
261,384
I am trying to install additional drivers on Ubuntu 12.04. The application is returning an error. In the log file I can see various NVIDIA module failed to load. However, my PC do not have NVIDIA graphics card. Its Intel card, then why is Ubuntu searching for NVIDIA card? I have installed Ubuntu 12.04 and additional d...
2013/02/26
[ "https://askubuntu.com/questions/261384", "https://askubuntu.com", "https://askubuntu.com/users/135680/" ]
**Yes**, but you will need Ubuntu 12.10. 1. Download Steam from Ubuntu Software Center 2. Start it up, you will be asked to log in with your Steam account. If you don't have one you can choose the create account option. 3. Go to the Store tab 4. Enter Don't Starve in the search bar in the top-right and click Don't Sta...
**Install from Chrome Webstore and play via Google Chrome** Yes you can, altough Linux isn't officially supported according to the game's website ([system requirements](http://www.dontstarvegame.com/blog/system-requirements)), but the game is available in the *Chrome Webstore* for all platforms: [Chrome Web Store - D...
3,195,720
I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ? This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und...
2010/07/07
[ "https://Stackoverflow.com/questions/3195720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277128/" ]
Writing to a file is not possible, you'd have to write a server-side script and make a request to that script. Reading is possible if you use an iframe with the text file's location as source, and reading the iframe contents.
Javascript in browsers doesn't allow you to write local files, for **security reasons**. This **may change with time**, but as for now you have to **deal with it**.
3,195,720
I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ? This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und...
2010/07/07
[ "https://Stackoverflow.com/questions/3195720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277128/" ]
Writing to a file is not possible, you'd have to write a server-side script and make a request to that script. Reading is possible if you use an iframe with the text file's location as source, and reading the iframe contents.
Only with a server side javascript interpreter, but that isn't the typical environment you run javascript in.
3,195,720
I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ? This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und...
2010/07/07
[ "https://Stackoverflow.com/questions/3195720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277128/" ]
Writing to a file is not possible, you'd have to write a server-side script and make a request to that script. Reading is possible if you use an iframe with the text file's location as source, and reading the iframe contents.
What about cookies? It is accessible via javascript, it is on your client and it is a plain text file. Only issue is the size of it (4k max if I remember well). What you can do as well is use your browser localStorage / userData / globalStorage (depending on your browser version). It acts like cookies (new webStorage ...
3,195,720
I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ? This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und...
2010/07/07
[ "https://Stackoverflow.com/questions/3195720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277128/" ]
**It *is* possible to read/write to a local file via JavaScript**: take a look at [TiddlyWIki](http://www.tiddlywiki.com/). *(Caveat: only works for local documents.)* I have actually written a [Single Page Application](http://softwareas.com/towards-a-single-page-application-framework) (SPA) using [twFile](http://jque...
Javascript in browsers doesn't allow you to write local files, for **security reasons**. This **may change with time**, but as for now you have to **deal with it**.